
$(document).ready(function(){
	var rootPath = getRootPath();
	
	$.ajax({
		headers: {'Cookie' : document.cookie },
		method : 'get',
		url : rootPath+'/customer/api/v1/memberInfo',
		dataType:"json", 
		async: false,
		contentType:"application/json",               
		data:null, 
		error:function(XMLHttpRequest, ajaxOptions, thrownError){
			alert("未连接服务器!");
		},
		success : function(resultData){
			$.each(resultData,function(maintainSelIndex,maintainSelObj){
				$.ajax({
					method : 'get',
					url : rootPath+'/points/api/v1/Countpoint?userId='+maintainSelObj.userId+'',
					error:function(XMLHttpRequest, ajaxOptions, thrownError){
						alert("连接服务器错误!");
					},
					success : function(resultData){
						$.each(resultData,function(maintainIndex,customerpointsdto){
							if(customerpointsdto==null){
								$("#pointcount").html(0);
							}else{
								$("#pointcount").html(customerpointsdto.changeafter);
							}
						});
						
					}
				});
			});
		}
	});
	
})
